<template>
  <div>
    <h4>我是子</h4>
    <h5>{{ count }}</h5>
    <button @click="add">++++</button>
    <hr />
    <Tab/>
  </div>
</template>

<script>
import Tab from "./Tab/Tab.vue";
import PubSub from "pubsub-js";
export default {
  name: "List",
  components: {
    Tab,
  },
  data() {
    return {
      count: 0,
    };
  },
  methods:{
    add(){
        this.count++
        //发布订阅
        PubSub.publish("yinwei",this.count)
    }
  }

};
</script>

<style>
</style>